﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class StartSelect : MonoBehaviour
{
    private bool isUp = true;

    public Transform transform1;
    public Transform transform2;

    // Start is called before the first frame update
    void Start()
    {
        transform.position = transform1.position;

    }

    // Update is called once per frame
    void Update()
    {

    }

    private void FixedUpdate()
    {
        float v = Input.GetAxisRaw("Vertical");
        //向上
        if (v > 0)
        {
            if (!isUp)
            {
                isUp = true;
                transform.position = transform1.position;
            }
        }
        else if (v < 0)
        {
            if (isUp)
            {
                isUp = false;
                transform.position = transform2.position;
            }
        }
        if (isUp && Input.GetKey(KeyCode.Space))
        {
            //加载第二个场景，在File 》 build setting ...  设置好了的
            SceneManager.LoadScene(1);
        }
        // if (Input.GetKey(KeyCode.KeypadEnter))
        // {

        // }
    }
}
